package com.catering.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName d_voucher
 */
@TableName(value ="d_voucher")
@Data
public class DVoucher implements Serializable {
    /**
     * 优惠卷ID
     */
    @TableId(type = IdType.AUTO)
    private Integer vid;

    /**
     * 优惠卷名称
     */
    private String vname;

    /**
     * 优惠券类型
     */
    private String couponType;

    /**
     * 面值
     */
    private Long price;

    /**
     * 使用条件
     */
    private String usingConditions;

    /**
     * 有效时间
     */
    private Date useTime;

    /**
     * 数量
     */
    private Integer number;

    /**
     * 发布状态(0代表未过期，1代表已过期)
     */
    private Integer publicationStatus;

    /**
     * 生效状态(0代表未生效，1代表已生效)
     */
    private Integer effectiveStatus;

    /**
     * 操作人
     */
    private Integer createby;

    /**
     * 备注
     */
    private String remark;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DVoucher other = (DVoucher) that;
        return (this.getVid() == null ? other.getVid() == null : this.getVid().equals(other.getVid()))
            && (this.getVname() == null ? other.getVname() == null : this.getVname().equals(other.getVname()))
            && (this.getCouponType() == null ? other.getCouponType() == null : this.getCouponType().equals(other.getCouponType()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getUsingConditions() == null ? other.getUsingConditions() == null : this.getUsingConditions().equals(other.getUsingConditions()))
            && (this.getUseTime() == null ? other.getUseTime() == null : this.getUseTime().equals(other.getUseTime()))
            && (this.getNumber() == null ? other.getNumber() == null : this.getNumber().equals(other.getNumber()))
            && (this.getPublicationStatus() == null ? other.getPublicationStatus() == null : this.getPublicationStatus().equals(other.getPublicationStatus()))
            && (this.getEffectiveStatus() == null ? other.getEffectiveStatus() == null : this.getEffectiveStatus().equals(other.getEffectiveStatus()))
            && (this.getCreateby() == null ? other.getCreateby() == null : this.getCreateby().equals(other.getCreateby()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getVid() == null) ? 0 : getVid().hashCode());
        result = prime * result + ((getVname() == null) ? 0 : getVname().hashCode());
        result = prime * result + ((getCouponType() == null) ? 0 : getCouponType().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getUsingConditions() == null) ? 0 : getUsingConditions().hashCode());
        result = prime * result + ((getUseTime() == null) ? 0 : getUseTime().hashCode());
        result = prime * result + ((getNumber() == null) ? 0 : getNumber().hashCode());
        result = prime * result + ((getPublicationStatus() == null) ? 0 : getPublicationStatus().hashCode());
        result = prime * result + ((getEffectiveStatus() == null) ? 0 : getEffectiveStatus().hashCode());
        result = prime * result + ((getCreateby() == null) ? 0 : getCreateby().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", vid=").append(vid);
        sb.append(", vname=").append(vname);
        sb.append(", couponType=").append(couponType);
        sb.append(", price=").append(price);
        sb.append(", usingConditions=").append(usingConditions);
        sb.append(", useTime=").append(useTime);
        sb.append(", number=").append(number);
        sb.append(", publicationStatus=").append(publicationStatus);
        sb.append(", effectiveStatus=").append(effectiveStatus);
        sb.append(", createby=").append(createby);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
